package com.dragon.modules.yuegou.mapper.product;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.dragon.modules.yuegou.entity.product.CoupMerchantCouponEntity;
import com.dragon.modules.yuegou.model.product.ReleasablePageListGrant;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

/**
 * 商户商品券（商户购买优惠券，然后送给会员） Mapper接口
 *
 * @author pbuilder generated
 * @date 2021-05-11 16:55:17
 * @version 2.0
 */
@Component("proCoupMerchantCouponMapper")
public interface CoupMerchantCouponMapper extends BaseMapper<CoupMerchantCouponEntity> {


    IPage<ReleasablePageListGrant> releasableList(IPage<CoupMerchantCouponEntity> toPage, @Param("merchantId") String merchantId);

    /****
     * 商户商品券数量变化
     * @param id 商户优惠券id
     * @param num 数量
     */
    int changeStock(@Param("id")String id, @Param("num")int num);
}
